package com.cy.ui;


import com.cy.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author : 残影
 * @Date: 2020-09-12 11:43
 */
public class Client {
    public static void main(String[] args) {
        //1.获取核心容器对象
        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
        //2.根据id获取对象
        AccountService accountService = (AccountService) ac.getBean("accountService");
        AccountService accountService2 = (AccountService) ac.getBean("accountService2");
        AccountService accountService3 = (AccountService) ac.getBean("accountService3");
        accountService.saveAccount();
        accountService2.saveAccount();
        accountService3.saveAccount();
        System.out.println(accountService);
        System.out.println(accountService2);
        System.out.println(accountService3);

    }
}
